//
//  UserGuideViewController.m
//  Dreamer
//
//  Created by dllo on 16/4/25.
//  Copyright © 2016年 Apon. All rights reserved.
//
#import "FreeTravelMacro.h"
#import "UserGuideViewController.h"
#import "CommendViewController.h"
#import "MainViewController.h"
@interface UserGuideViewController ()
@property(nonatomic,retain)UIImageView *imageViewOfFirst;
@property(nonatomic,retain)UIImageView *imageViewOfSecond;
@property(nonatomic,retain)UIImageView *imageViewOfThird;
@end

@implementation UserGuideViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    [self initGuide];
}
#pragma mark - 引导页
-(void)initGuide{
    UIScrollView *scrollView = [[UIScrollView alloc]initWithFrame:self.view.bounds];
    scrollView.contentSize = CGSizeMake(SCREEN_WIDTH *3, 0);
    scrollView.pagingEnabled = YES;
    //scrollView.bounces = NO;
    self.imageViewOfFirst = [[UIImageView alloc]initWithFrame:CGRectMake(0, 0, SCREEN_WIDTH, SCREEN_HEIGHT)];
    _imageViewOfFirst.image = [UIImage imageNamed:@"6f47c6a4b3"];
    [scrollView addSubview:_imageViewOfFirst];
    
    
    self.imageViewOfSecond = [[UIImageView alloc]initWithFrame:CGRectMake(SCREEN_WIDTH, 0, SCREEN_WIDTH, SCREEN_HEIGHT)];
    _imageViewOfSecond.image = [UIImage imageNamed:@"3f1edbba909d4d97ae0a077b4aaf39d5"];
    [scrollView addSubview:_imageViewOfSecond];
    
    
    self.imageViewOfThird = [[UIImageView alloc]initWithFrame:CGRectMake(SCREEN_WIDTH*2, 0, SCREEN_WIDTH, SCREEN_HEIGHT)];
    _imageViewOfThird.image = [UIImage imageNamed:@"b71db447fc"];
    [scrollView addSubview:_imageViewOfThird];
    
    
    UIButton *button = [UIButton buttonWithType:UIButtonTypeCustom];

    [button setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
    button.frame = CGRectMake(100, 300, SCREEN_WIDTH - 200, 50);
   //按钮边框
//    [button.layer setBorderWidth:1.0];
//    CGColorSpaceRef colorSpace = CGColorSpaceCreateDeviceRGB();
//    CGColorRef colorref = CGColorCreate(colorSpace,(CGFloat[]){ 1, 0, 0, 1 });
//    [button.layer setBorderColor:colorref];//边框颜色
    [button setImage:[UIImage imageNamed:@"Introduce-Image-2-Go"] forState:UIControlStateNormal];
    [button addTarget:self action:@selector(firstPressed) forControlEvents:UIControlEventTouchUpInside];
    [_imageViewOfThird addSubview:button];
    _imageViewOfThird.userInteractionEnabled=YES;
    [self.view addSubview:scrollView];
    
}
-(void)firstPressed{
    
    
    MainViewController *vc= [MainViewController new];
    
    
    [self presentViewController:vc animated:YES completion:^{
       
    }];
    
}
- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
